inherited fmUserPermissions: TfmUserPermissions
  Left = 285
  Top = 214
  Width = 925
  Height = 554
  Caption = #1060#1091#1085#1082#1094#1080#1086#1085#1072#1083#1100#1085#1099#1077' '#1087#1088#1072#1074#1072' '#1087#1086#1083#1100#1079#1086#1074#1072#1090#1077#1083#1077#1081
  Constraints.MinHeight = 554
  Constraints.MinWidth = 925
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 493
    Width = 917
  end
  inherited Panel1: TPanel
    Width = 917
    Visible = False
    inherited BitBtn1: TBitBtn
      Left = 747
    end
    inherited BitBtn2: TBitBtn
      Left = 835
    end
  end
  object Panel2: TPanel [2]
    Left = 0
    Top = 45
    Width = 917
    Height = 41
    Align = alTop
    TabOrder = 2
    object lcbGroups: TcxLookupComboBox
      Left = 48
      Top = 8
      Properties.DropDownRows = 20
      Properties.KeyFieldNames = 'UPGID'
      Properties.ListColumns = <
        item
          Caption = #8470' '#1043#1088#1091#1087#1087#1099
          FieldName = 'UPGID'
        end
        item
          Caption = #1054#1087#1080#1089#1072#1085#1080#1077' '#1075#1088#1091#1087#1087#1099
          FieldName = 'UPGDESCR'
        end>
      Properties.ListFieldIndex = 1
      Properties.ListSource = dlgDS
      Properties.OnCloseUp = lcbGroupsPropertiesCloseUp
      TabOrder = 0
      Width = 857
    end
    object cxLabel1: TcxLabel
      Left = 8
      Top = 8
      Caption = #1043#1088#1091#1087#1087#1072
    end
  end
  object Panel3: TPanel [3]
    Left = 481
    Top = 86
    Width = 436
    Height = 407
    Align = alClient
    TabOrder = 3
    object cxLabel2: TcxLabel
      Left = 1
      Top = 1
      Align = alTop
      Caption = #1057#1086#1090#1088#1091#1076#1085#1080#1082#1080' '#1074' '#1075#1088#1091#1087#1087#1077
    end
    object dbgG: TcxGrid
      Left = 1
      Top = 18
      Width = 434
      Height = 388
      Align = alClient
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -13
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
      TabOrder = 1
      LookAndFeel.Kind = lfStandard
      object tvG: TcxGridDBTableView
        OnDblClick = tvGDblClick
        NavigatorButtons.ConfirmDelete = False
        NavigatorButtons.PriorPage.Visible = True
        NavigatorButtons.Next.Visible = True
        NavigatorButtons.Insert.Visible = True
        NavigatorButtons.Append.Visible = False
        NavigatorButtons.Edit.Visible = False
        NavigatorButtons.Post.Visible = True
        NavigatorButtons.Cancel.Visible = False
        NavigatorButtons.Refresh.Visible = False
        NavigatorButtons.SaveBookmark.Visible = False
        NavigatorButtons.GotoBookmark.Visible = False
        NavigatorButtons.Filter.Visible = False
        FilterBox.Position = fpTop
        OnCellClick = tvEmplCellClick
        DataController.DataSource = dsG
        DataController.Summary.DefaultGroupSummaryItems = <>
        DataController.Summary.FooterSummaryItems = <
          item
            Kind = skCount
            FieldName = 'PID'
            Column = tvGPP
          end>
        DataController.Summary.SummaryGroups = <>
        Filtering.ColumnFilteredItemsList = True
        OptionsBehavior.CellHints = True
        OptionsBehavior.IncSearch = True
        OptionsCustomize.ColumnFiltering = False
        OptionsData.CancelOnExit = False
        OptionsData.Editing = False
        OptionsView.CellEndEllipsis = True
        OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
        OptionsView.CellAutoHeight = True
        OptionsView.CellTextMaxLineCount = 1
        OptionsView.ColumnAutoWidth = True
        OptionsView.Footer = True
        OptionsView.GroupFooters = gfVisibleWhenExpanded
        OptionsView.HeaderEndEllipsis = True
        OptionsView.Indicator = True
        Preview.Visible = True
        Styles.Header = DMInv.cxSiniyText
        object tvGPP: TcxGridDBColumn
          Caption = #1060#1048#1054
          DataBinding.FieldName = 'PP'
          Width = 376
        end
        object tvGSDNAME: TcxGridDBColumn
          Caption = #1057#1090#1072#1090#1091#1089
          DataBinding.FieldName = 'SDNAME'
          Width = 294
        end
      end
      object cxGridLevel2: TcxGridLevel
        GridView = tvG
      end
    end
  end
  object Panel4: TPanel [4]
    Left = 0
    Top = 86
    Width = 473
    Height = 407
    Align = alLeft
    TabOrder = 4
    object cxLabel3: TcxLabel
      Left = 1
      Top = 1
      Align = alTop
      Caption = #1057#1086#1090#1088#1091#1076#1085#1080#1082#1080' '#1074#1085#1077' '#1075#1088#1091#1087#1087#1099
    end
    object dbgEmpl: TcxGrid
      Left = 1
      Top = 18
      Width = 471
      Height = 388
      Align = alClient
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -13
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
      TabOrder = 1
      LookAndFeel.Kind = lfStandard
      object tvEmpl: TcxGridDBTableView
        OnDblClick = tvEmplDblClick
        NavigatorButtons.ConfirmDelete = False
        NavigatorButtons.PriorPage.Visible = True
        NavigatorButtons.Next.Visible = True
        NavigatorButtons.Insert.Visible = True
        NavigatorButtons.Append.Visible = False
        NavigatorButtons.Edit.Visible = False
        NavigatorButtons.Post.Visible = True
        NavigatorButtons.Cancel.Visible = False
        NavigatorButtons.Refresh.Visible = False
        NavigatorButtons.SaveBookmark.Visible = False
        NavigatorButtons.GotoBookmark.Visible = False
        NavigatorButtons.Filter.Visible = False
        FilterBox.Position = fpTop
        OnCellClick = tvEmplCellClick
        DataController.DataSource = dsEmpl
        DataController.Summary.DefaultGroupSummaryItems = <>
        DataController.Summary.FooterSummaryItems = <
          item
            Kind = skCount
            FieldName = 'PID'
            Column = tvEmplPP
          end>
        DataController.Summary.SummaryGroups = <>
        Filtering.ColumnFilteredItemsList = True
        OptionsBehavior.CellHints = True
        OptionsBehavior.IncSearch = True
        OptionsCustomize.ColumnFiltering = False
        OptionsData.CancelOnExit = False
        OptionsData.Editing = False
        OptionsView.CellEndEllipsis = True
        OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
        OptionsView.CellAutoHeight = True
        OptionsView.CellTextMaxLineCount = 1
        OptionsView.ColumnAutoWidth = True
        OptionsView.Footer = True
        OptionsView.GroupFooters = gfVisibleWhenExpanded
        OptionsView.HeaderEndEllipsis = True
        OptionsView.Indicator = True
        Preview.Visible = True
        Styles.Header = DMInv.cxSiniyText
        object tvEmplPP: TcxGridDBColumn
          Caption = #1060#1048#1054
          DataBinding.FieldName = 'PP'
          Width = 282
        end
        object tvEmplSDNAME: TcxGridDBColumn
          Caption = #1057#1090#1072#1090#1091#1089
          DataBinding.FieldName = 'SDNAME'
          Width = 173
        end
      end
      object cxGridLevel1: TcxGridLevel
        GridView = tvEmpl
      end
    end
  end
  object cxSplitter1: TcxSplitter [5]
    Left = 473
    Top = 86
    Width = 8
    Height = 407
    HotZoneClassName = 'TcxMediaPlayer9Style'
    Control = Panel4
  end
  inherited dlgDS: TDataSource
    DataSet = qGroups
  end
  object qGroups: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT UP.UPGID, UP.UPGDESCR'
      'FROM UP_GROUPDESCR UP'
      'ORDER BY 1')
    Left = 288
    object qGroupsUPGID: TIntegerField
      FieldName = 'UPGID'
      Origin = '"UP_GROUPDESCR"."UPGID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qGroupsUPGDESCR: TIBStringField
      FieldName = 'UPGDESCR'
      Origin = '"UP_GROUPDESCR"."UPGDESCR"'
      Size = 255
    end
  end
  object qEmpl: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      
        'SELECT distinct P.PID, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE' +
        '(P.PNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    SD.SDNAME, PS.SDID'
      'FROM PEOPLE P'
      'INNER JOIN P_STATUS PS ON PS.PID = P.PID'
      'INNER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      'INNER JOIN USERS U ON U.PID = P.PID'
      'WHERE P.PISDELETE IS NULL'
      '    AND NOT EXISTS('
      '    SELECT UP.PID'
      '    FROM USER_PERMISSIONS UP'
      '    where UP.UPGROUPID = :UPGID'
      '    AND UP.PID = P.PID'
      '    )'
      'ORDER BY 2')
    Left = 264
    Top = 214
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'UPGID'
        ParamType = ptUnknown
      end>
    object qEmplPID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qEmplPP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qEmplSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qEmplSDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
  end
  object dsEmpl: TDataSource
    DataSet = qEmpl
    Left = 232
    Top = 214
  end
  object dsG: TDataSource
    DataSet = qG
    Left = 577
    Top = 206
  end
  object qG: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterInsert = qGAfterInsert
    CachedUpdates = True
    DataSource = dlgDS
    SQL.Strings = (
      
        'SELECT UP.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39 +
        ' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    SD.SDNAME'
      'FROM USER_PERMISSIONS UP'
      'INNER JOIN PEOPLE P ON P.PID = UP.PID'
      'INNER JOIN P_STATUS PS ON PS.PID = P.PID'
      'INNER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      'WHERE UP.UPGROUPID = :UPGID')
    UpdateObject = quG
    Left = 609
    Top = 206
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'UPGID'
        ParamType = ptUnknown
      end>
    object qGPID: TIntegerField
      FieldName = 'PID'
      Origin = '"USER_PERMISSIONS"."PID"'
    end
    object qGUPGROUPID: TIntegerField
      FieldName = 'UPGROUPID'
      Origin = '"USER_PERMISSIONS"."UPGROUPID"'
    end
    object qGPP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qGSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
  end
  object quG: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  PID,'
      '  UPGROUPID'
      'from USER_PERMISSIONS '
      'where'
      '  PID = :PID and'
      '  UPGROUPID = :UPGROUPID')
    ModifySQL.Strings = (
      'update USER_PERMISSIONS'
      'set'
      '  PID = :PID,'
      '  UPGROUPID = :UPGROUPID'
      'where'
      '  PID = :OLD_PID and'
      '  UPGROUPID = :OLD_UPGROUPID')
    InsertSQL.Strings = (
      'insert into USER_PERMISSIONS'
      '  (PID, UPGROUPID)'
      'values'
      '  (:PID, :UPGROUPID)')
    DeleteSQL.Strings = (
      'delete from USER_PERMISSIONS'
      'where'
      '  PID = :OLD_PID and'
      '  UPGROUPID = :OLD_UPGROUPID')
    Left = 641
    Top = 206
  end
end
